From: kfraser@localhost.localdomain Date: Tue, 3 Apr 2007 08:03:51 +0000 (+0100) Subject: Fix "xm migrate" hang on failure. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15270^2~4 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=9bea671737e07be91fb948c125cc4f02af5e2a77;p=xen.git Fix "xm migrate" hang on failure. If a domain fails to restore, report back an error and close the connection. This still leaves a confusing error from 'xm migrate' in many cases, but it's much better than just sitting there. Signed-off-by: John Levon --- diff --git a/tools/python/xen/xend/server/relocate.py b/tools/python/xen/xend/server/relocate.py index 3cdd43a5eb..8a28c85c0a 100644 --- a/tools/python/xen/xend/server/relocate.py +++ b/tools/python/xen/xend/server/relocate.py @@ -106,8 +106,12 @@ class RelocationProtocol(protocol.Protocol): def op_receive(self, name, _): if self.transport: self.send_reply(["ready", name]) - XendDomain.instance().domain_restore_fd( - self.transport.sock.fileno()) + try: + XendDomain.instance().domain_restore_fd( + self.transport.sock.fileno()) + except: + self.send_error() + self.close() else: log.error(name + ": no transport") raise XendError(name + ": no transport")